<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="button">按我</button>
    <script>
        function save(time,func){
            let ticktime
            console.log(ticktime)
            return function(){
                if(!ticktime){
                    ticktime=setTimeout(function(){
                        func()
                        ticktime = null
                    },time)
                }

            }
        }
        let click = document.getElementById('button')
        function reflect(){console.log("按了")}
        click.onclick= save(2000,reflect)
    </script>
</body>
</html>